com.highdeal.hci
Class OperationFailureErrorException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.highdeal.hci.OperationFailureException
              extended by com.highdeal.hci.OperationFailureErrorException
All Implemented Interfaces:
IErrorException, IXMLMarshallable, OperationResult, XMLMarshallable, java.io.Serializable
Direct Known Subclasses:
InvalidCreationErrorException, InvalidDeletionErrorException, InvalidMaintainErrorException, InvalidModificationErrorException, InvalidOperationErrorException, InvalidSearchErrorException, InvalidSubscriberDataExportErrorException, InvalidSubscriberDataImportErrorException, ServerErrorException

public abstract class OperationFailureErrorException
extends OperationFailureException
implements IErrorException, IXMLMarshallable

This abstract Java class is the base representation of an OperationFailureException that includes an error (error code and arguments, comprehensive message, potential causes); Consider the direct known subclasses: ServerErrorException, InvalidCreationErrorException, and other error exceptions.

This class should be implemented by all the failure exceptions.

This class implements both the IXMLMarshallable and the XMLMarshallable Java interfaces.

Implementation in Your Client Application

Consider the known subclasses that represent an HCI operation exception; They are listed in this page.

See Also:
Serialized Form

XML API for HCI

The XML APIs specify the following XSD fragment:

XSD Fragment

<xs:element name="cause" type="IErrorType" />
 <xs:element name="causedBy" type="IErrorType" />

 <xs:complexType name="IErrorType">
   <xs:sequence>
     <xs:element name="message" type="xs:string" />
     <xs:choice>
       <xs:element ref="string" />
       <xs:element ref="date" />
       <xs:element ref="number" />
       <xs:element ref="boolean" />
     </xs:choice>
   </xs:sequence>
   <xs:attribute name="module" type="xs:string" />
   <xs:attribute name="code" type="xs:integer" />
 </xs:complexType>

 <xs:complexType name="OperationFailureError">
   <xs:sequence>
     <xs:element ref="cause" minOccurs="1" maxOccurs="1"/>
     <xs:element ref="causedBy" minOccurs="0" maxOccurs="unbounded"/>
   </xs:sequence>
 </xs:complexType>


Field Summary
static java.lang.String CAUSE_TAG_NAME
          Constant for the XML tag name of the error embedded in the Operation Failure: "cause"
static java.lang.String CAUSED_BY_TAG_NAME
          Constant for the XML tag name of the nested IErrors errors embedded in the Operation Failure: "causedBy"
static java.lang.String MESSAGE_TAG_NAME
          Constant for the XML tag name of the message describing the error embedded in the Operation Failure: "message"
 
Constructor Summary
OperationFailureErrorException()
          Default constructor of the Operation Failure exception used to unmarshal its XML representation.
OperationFailureErrorException(IError error)
          Builds the Operation Failure exception with the specified IError.
OperationFailureErrorException(IError error, OperationFailureErrorException cause)
          Builds the Operation Failure exception with the specified IError and its triggering operation failure.
OperationFailureErrorException(IError error, java.lang.Throwable cause)
          Builds the Operation Failure exception with the specified IError and its triggering exception.
 
Method Summary
 void addChild(java.lang.String tagName, XMLMarshallable child)
          Adds a child to the object, the child representing the marshallable object which must be added to the element.
 IError getError()
          Gets the error included in this exception.
 java.lang.String getMessage()
          Returns the text message of the error in this exception.
abstract  java.lang.String getTagName()
          Gets the XML tag name of the HCI model.
 void marshal(XMLOutputter output)
          Gives an XML representation of this object, including its children.
 void marshalChildren(XMLOutputter output)
          Gives an XML representation of the child objects of an object.
static void marshalIError(XMLOutputter output, IError err)
          Marshals the error into the output.
 void setError(IError error)
          Sets the error contained in this Operation Failure.
static IError unmarshalIError(XMLMarshallable child)
          Unmarshals the error into the output.
 
Methods inherited from class com.highdeal.hci.OperationFailureException
getOperandReference
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.highdeal.hci.IXMLMarshallable
marshalAttributes
 
Methods inherited from interface com.highdeal.hci.XMLMarshallable
addCharacterData, setAttributes
 

Field Detail

CAUSE_TAG_NAME

public static final java.lang.String CAUSE_TAG_NAME
Constant for the XML tag name of the error embedded in the Operation Failure: "cause"

See Also:
Constant Field Values

CAUSED_BY_TAG_NAME

public static final java.lang.String CAUSED_BY_TAG_NAME
Constant for the XML tag name of the nested IErrors errors embedded in the Operation Failure: "causedBy"

See Also:
Constant Field Values

MESSAGE_TAG_NAME

public static final java.lang.String MESSAGE_TAG_NAME
Constant for the XML tag name of the message describing the error embedded in the Operation Failure: "message"

See Also:
Constant Field Values
Constructor Detail

OperationFailureErrorException

public OperationFailureErrorException()
Default constructor of the Operation Failure exception used to unmarshal its XML representation.


OperationFailureErrorException

public OperationFailureErrorException(IError error)
Builds the Operation Failure exception with the specified IError.

Parameters:
error - The IError to embed in the operation failure

OperationFailureErrorException

public OperationFailureErrorException(IError error,
                                      OperationFailureErrorException cause)
Builds the Operation Failure exception with the specified IError and its triggering operation failure.

Parameters:
error - The IError to embed in the operation failure
cause - The Operation Failure that has triggered the current Operation Failure

OperationFailureErrorException

public OperationFailureErrorException(IError error,
                                      java.lang.Throwable cause)
Builds the Operation Failure exception with the specified IError and its triggering exception.

Parameters:
error - The IError to embed in the operation failure
cause - The exception that has triggered the current Operation Failure
Method Detail

getMessage

public java.lang.String getMessage()
Returns the text message of the error in this exception.

Overrides:
getMessage in class java.lang.Throwable
Returns:
The error message

getError

public IError getError()
Description copied from interface: IErrorException
Gets the error included in this exception.

Specified by:
getError in interface IErrorException
Returns:
The error associated in this exception

setError

public void setError(IError error)
Sets the error contained in this Operation Failure.

Parameters:
error - The IError to embed in this operation failure

getTagName

public abstract java.lang.String getTagName()
Gets the XML tag name of the HCI model.

Returns:
The XML tag name

marshal

public final void marshal(XMLOutputter output)
Description copied from interface: XMLMarshallable
Gives an XML representation of this object, including its children.

Specified by:
marshal in interface IXMLMarshallable
Specified by:
marshal in interface XMLMarshallable
Parameters:
output - The XML output to marshal the object into

marshalChildren

public void marshalChildren(XMLOutputter output)
Description copied from interface: IXMLMarshallable
Gives an XML representation of the child objects of an object.

Specified by:
marshalChildren in interface IXMLMarshallable
Parameters:
output - The XML output to marshal the child objects into

addChild

public void addChild(java.lang.String tagName,
                     XMLMarshallable child)
Description copied from interface: XMLMarshallable
Adds a child to the object, the child representing the marshallable object which must be added to the element.

Specified by:
addChild in interface XMLMarshallable
Parameters:
tagName - The name of tag for the child
child - The child to be added

marshalIError

public static final void marshalIError(XMLOutputter output,
                                       IError err)
Marshals the error into the output.

Parameters:
output - The output to marshal the error into
err - The error to marshal

unmarshalIError

public static final IError unmarshalIError(XMLMarshallable child)
Unmarshals the error into the output.

Parameters:
child - The element to read the error from
Returns:
The error

Document Published: October 2015 (SAP CC 4.0 SP10 and Later)